const defaultOptions = {
    tips: {
        title: "",
        download: false,
        backgroundColor: "",
		theme:null
    },
    legend: {
        show: true,
        orient: "horizontal",
        left: "center",
        top: "top",
        bottom: "auto",
        right: "auto",
        itemGap: 8,
        padding: 1,
        textStyle: {},
    },
    tooltip: {
        trigger: "item",
        show: true,
        confine: true,
    },
    toolbox: {
        show: true,
        feature: {
            saveAsImage: {
                type:'png'
            },
            restore: {},
            dataView: {},
            dataZoom: {},
            magicType: {},
        },
    },
    series: [],
};

function mergeOption(options) {
    return Object.assign({}, defaultOptions, options);
}
export const charts_types = [{
        type: "datatablenoneng",
        name: "普通二维表格",
        icon: "iconfont cboarddashujukeshihuaico-",
        des: "普通二维表格，适合大数据量（10w以上数据量）",
        rule: {
            column: 0,
            row: -1,
            value: -1,
        },
        options: {
            tips: {
                title: "",
                download: false,
            },
        },
    },
    {
        type: "pivot_table",
        name: "钻取表格",
        icon: "iconfont cboardlunbobiaoge",
        des: "钻取表格(前端计算,数据量最好低于2W)",
        rule: {
            column: -1,
            row: -1,
            value: -1,
        },
        disabled: false,
        options: {},
    },
    {
        type: "echarts_line",
        name: "坐标轴图",
        icon: "iconfont cboardzhuzhuangtu",
        des: "坐标轴图",
        rule: {
            column: 0,
            row: -1,
            value: -1,
        },
        options: mergeOption({
            tooltip: {
                trigger: "axis",
            },
            grid: {
                top: "10%",
                left: 50,
                bottom: 60,
                show: true,
                right: 60,
            },
            yAxis: [{
                show: true,
                name: "",
                type: "value",
                position: "left",
                offset: 0,
            }, ],
            xAxis: [{
                axisLabel: {
                    show: true,
                    rotate: 0,
                    fontSize: 12,
                    interval: "auto",
                },
                type: "category",
            }, ],
            series: [{
                type: "line",
                yAxisIndex: 0,
                lineStyle: {},
                itemStyle: {},
                label: {
					show:false
				},
                // areaStyle: {},
            }, ],
        }),
    },
    {
        type: "echarts_pie",
        name: "饼图",
        icon: "iconfont cboardbingtu",
        des: "饼图",
        rule: {
            column: 0,
            row: -1,
            value: -1,
        },
        options: mergeOption({
            series: [{
                name: "",
                type: "pie",
                radius: [0, 100],
                center: ["50%", "50%"],
				roseType:false,
                label: {},
                labelLine: {
                    lineStyle: {},
                },
				itemStyle:{
					
				}
            }, ],
        }),
    },
    {
        type: "echarts_funnel",
        name: "漏斗图",
        icon: "iconfont cboardloudoutu",
        des: "漏斗图",
        rule: {
            column: 0,
            row: 1,
            value: 1,
        },
        options: {
            tips: {
                title: "",
                download: false,
            },
        },
    },
    {
        type: "g2_radar",
        name: "雷达图",
        icon: "iconfont cboardleidatu",
        des: "雷达图(最多8条数据，无事件)",
        rule: {
            column: 0,
            row: -1,
            value: -1,
        },
        options: {
            tips: {
                title: "",
                download: false,
            },
            radar: [{
                shape: "polygon",
            }, ],
        },
    },
    {
        type: "g2_gauge",
        name: "仪表盘",
        icon: "iconfont cboardyibiaopan",
        des: "仪表盘(只有百分比,无事件)",
        rule: {
            column: 0,
            row: 0,
            value: 2,
        },
        options: {
            tips: {
                title: "",
                download: false,
            },
        },
    },
    {
        type: "g2_water_wave",
        name: "水波图",
        icon: "iconfont cboardshuiweitu",
        des: "水波图(无事件)",
        rule: {
            column: 0,
            row: 0,
            value: 1,
        },
        options: {
            tips: {
                title: "",
                download: false,
            },
        },
    },
    {
        type: "g2_single_bar",
        name: "表格柱图",
        icon: "iconfont cboardbiaogezhuzhuangtu",
        des: "单一柱状(无事件)",
        rule: {
            column: 0,
            row: -1,
            value: -1,
        },
        options: {},
    },
    {
        type: "g2_tag_cloud",
        name: "词云",
        icon: "iconfont cboardciyun",
        des: "词云(无事件)",
        rule: {
            column: 0,
            row: 1,
            value: 1,
        },
        options: {
            tips: {
                title: "",
                download: false,
            },
            tooltip: {
                show: true,
                trigger: "item",
            },
            series: [{
                name: "",
                type: "wordCloud",
                shape: "circle",
                radius: "60%",
                center: ["50%", "50%"],
                rotationStep: 45,
                gridSize: 8,
                width: "100%",
                height: "100%",
                drawOutOfBound: false,
                textStyle: {
                    normal: {
                        fontFamily: "sans-serif",
                        fontWeight: "bold",
                        // Color can be a callback function or a color string
                        color: function() {
                            // Random color
                            return (
                                "rgb(" + [
                                    Math.round(Math.random() * 160),
                                    Math.round(Math.random() * 160),
                                    Math.round(Math.random() * 160),
                                ].join(",") +
                                ")"
                            );
                        },
                    },
                    emphasis: {
                        shadowBlur: 10,
                        shadowColor: "#333",
                    },
                },
                data: [],
            }, ],
        },
    },
    {
        type: "g2_mini_area",
        name: "迷你区域图",
        icon: "iconfont cboardzhuzhuangtu-tianchong",
        des: "迷你区域图(无事件)",
        rule: {
            column: 0,
            row: 1,
            value: 1,
        },
        disabled: false,
        options: mergeOption({
            toolbox: {
                show: false,
            },
            tooltip: {
                trigger: "axis",
                confine: true,
            },
            grid: {
                show: false,
                top: 10,
                left: 10,
                right: 10,
                bottom: 0,
            },
            xAxis: [{
                show: false,
                type: "category",
                boundaryGap: false,
                data: [],
                axisLabel: {
                    show: true,
                    rotate: 0,
                    fontSize: 12,
                    interval: "auto",
                },
            }, ],
            yAxis: [{
                show: false,
                name: "",
                type: "value",
                position: "left",
                offset: 0,
            }, ],
            series: [{
                type: "line",
                name: "",
                lineStyle: {},
                label: {},
                itemStyle: {},
                areaStyle: {},
                data: [],
            }, ],
        }),
    },
    {
        type: "g2_mini_bar",
        name: "迷你柱状图",
        icon: "iconfont cboardzhuzhuangtu1",
        des: "迷你柱状图(无事件)",
        rule: {
            column: 0,
            row: 1,
            value: 1,
        },
        disabled: false,
        options: mergeOption({
            toolbox: {
                show: false,
            },
            tooltip: {
                trigger: "axis",
                confine: true,
            },
            grid: {
                show: false,
                top: 10,
                left: 10,
                right: 10,
                bottom: 0,
            },
            xAxis: [{
                show: false,
                type: "category",
                boundaryGap: false,
                data: [],
                axisLabel: {
                    show: true,
                    rotate: 0,
                    fontSize: 12,
                    interval: "auto",
                },
            }, ],
            yAxis: [{
                show: false,
                name: "",
                type: "value",
                position: "left",
                offset: 0,
            }, ],
            series: [{
                type: "bar",
                name: "",
                label: {},
                itemStyle: {},
                backgroundStyle: {},
                data: [],
                markPoint: {},
                markLine: {},
                markArea: {},
            }, ],
        }),
    },
    {
        type: "echarts_graph",
        name: "关系图",
        icon: "iconfont cboardguanxitu",
        des: "关系图(无事件)",
        rule: {
            column: 1,
            row: -1,
            value: -1,
        },
        disabled: false,
        options: mergeOption({
            series: [{
                type: "graph",
                name: "",
                layout: "force",
                force: {
                    repulsion: 500,
                },
                data: [],
                links: [],
                categories: [],
                focusNodeAdjacency: true,
                roam: true,
                label: {
                    normal: {
                        show: true,
                        position: "top",
                    },
                },
                lineStyle: {
                    normal: {
                        color: "source",
                        curveness: 0,
                        type: "solid",
                    },
                },
                edgeSymbol: ["circle", "arrow"],
                edgeSymbolSize: [0, 8],
                edgeLabel: {
                    normal: {
                        show: true,
                        textStyle: {
                            color: "#333",
                        },
                        formatter: "{c}",
                    },
                },
            }, ],
        }),
    },
    {
        type: "component_timeline",
        name: "时间轴",
        icon: "iconfont cboardshuxing",
        des: "时间轴（无事件）",
        rule: {
            column: 0,
            row: 1,
            value: -1,
        },
        disabled: false,
        options: {
            tips: {
                title: "",
                type: "left",
            },
        },
    },
	{
	    type: "singleKPI",
	    name: "单一指标卡",
	    icon: "iconfont cboardshuiweitu",
	    des: "单一指标卡（无事件）",
	    rule: {
	        column: 0,
	        row: 0,
	        value: 1,
	    },
	    disabled: false,
	    options: {
	     tips: {
	         title: "",
	         backgroundColor: "rgba(255,255,255,1)",
	     },
	     indicator: [],
		 valueColor:'rgba(0,0,0,1)',
		 titleColor:'rgba(0,0,0,1)',
		 fontSize:12,
		 fontSize_zhibiao:30,
		 isBolder:false
	    },
	},
    {
        type: "kpi_card_water",
        name: "KPI水波图",
        icon: "iconfont cboardshuiweitu",
        des: "KPI水波图（无事件）",
        rule: {
            column: 0,
            row: 1,
            value: -1,
        },
        options: {
            tips: {
                title: "",
                download: false,
            },
        },
    },
    {
        type: "kpi_indicator_card",
        name: "KPI指标卡",
        icon: "iconfont cboardshuiweitu",
        des: "KPI指标卡（支持一个或多个指标）",
        rule: {
            column: 0,
            row: 0,
            value: -1,
        },
        options: {
            tips: {
                title: "",
                backgroundColor: "#ffffff",
            },
            indicator: [],
        },
    },
];